options nocenter;
libname replicat 'c:\measure\replicat\sas';
filename ewmvalid 'c:\measure\replicat\sas\ewmvalid.dat';
data ewmvalid;
        infile ewmvalid;
        input state ideo pollib2 leglib ideo93 klinglam;
data test;
        set replicat.ideology;
data test1;
        set test;
        if 60<year<79;
proc means noprint mean;
        by state;
        var citizen install;
        output out=subset1 mean=cit78 inst78;
data test2;
        set test;
        if 75<year<83;
proc means noprint mean;
        by state;
        var citizen install;
        output out=subset2 mean=cit82 inst82;
data test3;
        set test;
        if 75<year<89;
proc means noprint mean;
        by state;
        var citizen install;
        output out=subset3 mean=cit88 inst88;
data replicat.ewmvalid;
        merge ewmvalid subset1 subset2 subset3;
        by state;
if state=28 then ideo93=.;
proc corr;
        var ideo ideo93 leglib cit82 cit88 inst82;
proc corr;
        var pollib2 klinglam cit82 inst82 cit88 inst88 cit78 inst78;
run;
